package com.alex.core.contants.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 汽车充电桩类型
 * @author cb
 * @date 2019/10/17 14:19
 */
@Getter
@AllArgsConstructor
public enum CarPileTypeEnum {
    // 电流类型,1:交流（慢充）,2:直流（快充）,3:未知
    DC(2, "直流电桩"),
    AC(1, "交流电桩"),
    UN_KHOWN(3, "未知"),

    ;
    private final Integer code;
    private final String value;

    public static CarPileTypeEnum getByCode(Integer code) {
        for (CarPileTypeEnum carPileTypeEnum : values()) {
            if (carPileTypeEnum.code.equals(code)) {
                return carPileTypeEnum;
            }
        }
        return null;
    }
}
